package com.example;

import com.example.factory.MyClassPathXmlApplicationContext;
import com.example.factory.MyFactory;
import com.example.service.UserService;

public class Starter {
    public static void main(String[] args) {
        //先得到我们的一个工厂类
        MyFactory myFactory=new MyClassPathXmlApplicationContext("spring.xml");
        //然后通过myFactory的方法，得到指定的Bean对象
        UserService userService = (UserService) myFactory.getBean("userService");
        userService.test();
    }
}
